﻿namespace Sidvall.Business
{
    public class BusinessRuleCollectionSettings
    {
        #region Public Members

        public BusinessRuleCollectionEvents EnabledBusinessRuleCollectionEvents { get; set; }

        #region Copy

        public BusinessRuleCollectionSettings Copy()
        {
            var item = new BusinessRuleCollectionSettings();
            item.Import(this);
            return item;
        }

        #endregion
        #region Import

        public void Import(BusinessRuleCollectionSettings item)
        {
            if (item == null)
                return;
            this.EnabledBusinessRuleCollectionEvents = item.EnabledBusinessRuleCollectionEvents;
        }

        #endregion
        #region ToString

        public override string ToString()
        {
            return this.EnabledBusinessRuleCollectionEvents.ToString();
        }

        #endregion

        #endregion
        #region Factory Members

        public static BusinessRuleCollectionSettings CreateSettings(BusinessRuleCollectionEvents enabledEvents)
        {
            return new BusinessRuleCollectionSettings()
            {
                EnabledBusinessRuleCollectionEvents = enabledEvents,
            };
        }
        public static BusinessRuleCollectionSettings CreateSettingsAll()
        {
            return new BusinessRuleCollectionSettings()
            {
                EnabledBusinessRuleCollectionEvents = BusinessRuleCollectionEvents.All,
            };
        }
        public static BusinessRuleCollectionSettings CreateSettingsNone()
        {
            return new BusinessRuleCollectionSettings()
            {
                EnabledBusinessRuleCollectionEvents = BusinessRuleCollectionEvents.None,
            };
        }

        #endregion
    }
}
